<template>
    <el-container>
        <el-main>
            <el-table :data="tableData" stripe element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" v-loading.fullscreen.lock="loading">
                <el-table-column prop="orderId" label="订单编号" width="80" />
                <el-table-column prop="userId" label="用户编号" width="80" />
                <el-table-column prop="nick" label="昵称" width="80" />
                <el-table-column prop="username" label="客户名称" width="80" />
                <el-table-column prop="head" label="客户头像" width="120">
                    <template #="{ head }">
                        <el-avatar shape="square" :size="100" :src="head" />
                    </template>
                </el-table-column>
                <el-table-column v-if="isShowPhone" prop="phone" label="手机号码" width="120" />
                <el-table-column prop="zsName" label="预约诊所" min-width="120" />
                <el-table-column prop="ysName" label="预约医生" width="80" />
                <el-table-column prop="orderTime" label="预约时间" min-width="110" />
                <el-table-column prop="status" label="成交状态" width="80">
                    <template #="{ status }">
                        <el-tag v-if="status == '1'">已成交</el-tag>
                    </template>
                </el-table-column>
                <el-table-column prop="dealState" label="缴费状态" width="80">
                    <template #="{payState}">
                        <el-tag v-if="payState == '0'">未缴费</el-tag>
                        <el-tag v-if="payState == '1'">已缴费</el-tag>
                    </template>
                </el-table-column>
                <el-table-column prop="dealBonus" label="奖金" width="100" :formatter="(row) => (row.dealBonus == 0 ? '' : row.dealBonus / 100)" />
                <el-table-column prop="giveTime" label="奖金发放时间" width="110" />
                <el-table-column prop="referrerNick" label="来源" width="80" />
            </el-table>
            <SearchPagination :currentPage="currentPage" :total="total" :limit="limit" @handleCurrentChange="handleCurrentChange" @handleSizeChange="handleSizeChange" />
        </el-main>
    </el-container>
</template>

<script>
import { page } from '@/chaos/functions/mixin/crud';

export default {
    name: 'admindeal',
    mixins: [page],
    data() {
        return {
            domain: 'iya_order',
            isShowPhone: true
        };
    },
    created() {
        this.isShowPhone =
            this.$store.getters.user.roleName == 'ADMIN' ||
            this.$store.getters.user.roleName == 'DEV';
        this.searchMethod = 'adminDeals';
        this.search();
    }
};
</script>
<style scoped></style>
